//
//  RecData.m
//  WuLi
//
//  Created by Gollum on 16/09/01
//  Copyright (c) Gollum. All rights reserved.
//

#import "RecData.h"
#import "RecNewsimageinfolist.h"
#import "RecWebpimageinfolist.h"
#import "RecParamap.h"
@implementation RecData

+ (NSDictionary *)objectClassInArray{
    return @{@"newsImageInfoList" : [RecNewsimageinfolist class], @"webpImageInfoList" : [RecWebpimageinfolist class]};
}

- (void)setValue:(id)value forKey:(NSString *)key{

    [super setValue:value forKey:key];
    NSMutableArray <RecNewsimageinfolist *>*newsImageArray = [NSMutableArray array];
    NSMutableArray <RecWebpimageinfolist *>*webpImageArray = [NSMutableArray array];
    NSArray *valueArray = value;
    if ([key isEqualToString:@"RecNewsimageinfolist"]) {
        
        for (NSDictionary *dic in valueArray) {
            RecNewsimageinfolist *newsImage = [RecNewsimageinfolist modelWithDic:dic];
            [newsImageArray addObject:newsImage];
        }
        _newsImageInfoList = newsImageArray;
    }
    if ([key isEqualToString:@"RecWebpimageinfolist"]) {
        for (NSDictionary *dic in valueArray) {
            RecWebpimageinfolist *webpImage = [RecWebpimageinfolist modelWithDic:dic];
            [webpImageArray addObject:webpImage];
        }
        _webpImageInfoList = webpImageArray;
    }
        if ([key isEqualToString:@"paraMap"]) {
            _paraMap = [RecParamap modelWithDic:value];
        }

}
@end
